- Notifications
You must be signed in to change notification settings - Fork 5.8k
/
Copy path383.Ransom Note_test.go
51 lines (40 loc) · 707 Bytes
/
383.Ransom Note_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package leetcode
import (
"fmt"
"testing"
)
typequestion383struct {
para383
ans383
}
// para 是参数
typepara383struct {
ransomNotestring
magazinestring
}
// ans 是答案
typeans383struct {
ansbool
}
funcTest_Problem383(t*testing.T) {
qs:= []question383{
{
para383{"a", "b"},
ans383{false},
},
{
para383{"aa", "ab"},
ans383{false},
},
{
para383{"aa", "aab"},
ans383{true},
},
}
fmt.Printf("------------------------Leetcode Problem 383------------------------\n")
for_, q:=rangeqs {
_, p:=q.ans383, q.para383
fmt.Printf("【input】:%v 【output】:%v\n", p, canConstruct(p.ransomNote, p.magazine))
}
fmt.Printf("\n\n\n")
}